import request from "@/utils/request";

export const addUser = (data) => {
  return request({
    method: "POST",
    url: "/private/v1/users",
    data,
  });
};

export const getUser = (id) => {
  return request({
    method: "GET",
    url: "/private/v1/users/" + id,
  });
};

export const editUser = (id, data) => {
  return request({
    method: "PUT",
    url: "/private/v1/users/" + id,
    data,
  });
};

export const delUser = (id) => {
  return request({
    method: "DELETE",
    url: "/private/v1/users/" + id,
  });
};

export const seveRoes = (id, RoId) => {
  return request({
    method: "PUT",
    url: `/private/v1/users/${id}/role`,
    data: {
      rid: RoId,
    },
  });
};
